package Ep02_LinkedList._0083;

import Ep02_LinkedList.ListNode;

/**
 * @author Jimmy Zhan WORKSTATION
 * @date 2023/3/9 11:49
 * 说明：力扣 0083  滑动窗口
 */

public class Mine {
    public ListNode deleteDuplicates(ListNode head) {
        ListNode pre = new ListNode();
        ListNode cur = new ListNode();
        pre = head;
        cur = head;
        if (head == null){
            return null;
        }
        while (cur!=null){
            if(cur.val==pre.val){
                cur=cur.next;
            } else {
                pre.next=cur;
                pre = cur;
                cur = cur.next;
            }
        }
        if (cur==null){
            pre.next = null;
        }
        return head;
    }
}
